package de.tuhh.simsearch.dto;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.HashSet;
import java.util.Set;

import javax.xml.bind.annotation.XmlRootElement;

/**
 * CategoryDTO is the data transfer object for categories. It contains content type, category name and a list of
 * associated files, represented by their ids.
 * 
 * @author SimSearch 1
 * 
 */
@XmlRootElement(name = "category")
public class CategoryDTO implements Serializable {

  private static final long serialVersionUID = 6005341688971324469L;

  private String contentType;
  private String categoryName;
  private Set<BigInteger> files = new HashSet<BigInteger>();

  protected CategoryDTO() {

  }

  /**
   * The class constructor, sets the content type and the category name
   * 
   * @param contentType
   *          the string representation of the content type
   * @param categoryName
   *          the name of the category
   */
  public CategoryDTO(String contentType, String categoryName) {

    this.categoryName = categoryName;
    this.contentType = contentType;
  }

  /**
   * Gets the string representation of the content type
   * 
   * @return the content type
   */
  public String getContentType() {

    return contentType;
  }

  /**
   * Sets the content type as a string value
   * 
   * @param contentType
   *          the content type
   */
  public void setContentType(String contentType) {

    this.contentType = contentType;
  }

  /**
   * Gets the category name
   * 
   * @return the category name
   */
  public String getCategoryName() {

    return categoryName;
  }

  /**
   * Sets the category name
   * 
   * @param categoryName
   *          the category name
   */
  public void setCategoryName(String categoryName) {

    this.categoryName = categoryName;
  }

  /**
   * Gets the set of ids of associated files with this category
   * 
   * @return a set of file ids of associated files
   */
  public Set<BigInteger> getFiles() {

    return files;
  }

  /**
   * Sets the set of file ids
   * 
   * @param files
   *          the set of file ids to be set
   */
  public void setFiles(Set<BigInteger> files) {

    this.files = files;
  }

}
